{\rtf1\mac\ansicpg10000\cocoartf102
{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fnil\fcharset77 Monaco;
}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red0\green0\blue191;\red96\green96\blue96;
\red0\green115\blue0;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f0\b\fs36 \cf0 PV_MagGate			reduces magnitudes above or below thresh\

\f1\b0\fs24 \

\f0\b PV_MagGate.ar(buffer,  thresh, remove)\

\f1\b0 \
For positive values of thresh, acts something like a noise reduction.  For negative values, highlights smaller sounds.\

\f0\b buffer
\f1\b0  - fft buffer A.\

\f0\b thresh -
\f1\b0  if positive, scales magnitudes below thresh.  if negative scales magnitudes above abs(thresh)
\f0\b \
remove - 
\f1\b0 amount to scale magnitudes.\
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f2\fs18 \cf2 s.boot;\
(\
b = \cf3 Buffer\cf2 .alloc(s, 2048, 1);\
c = \cf3 Buffer\cf2 .read(s, \cf4 "sounds/a11wlk01.wav"\cf2 );\
)\
\
(\
\cf3 SynthDef\cf2 (\cf4 "help-magGate"\cf2 , \{ \cf3 arg\cf2  out=0, bufnum=0, soundBufnum=2;\
	\cf3 var\cf2  in, chain;\
	in = \cf3 PlayBuf\cf2 .ar(1, soundBufnum, \cf3 BufRateScale\cf2 .kr(soundBufnum), loop: 1);\
	chain = \cf3 FFT\cf2 (bufnum, in);\
	chain = \cf3 PV_MagGate\cf2 (chain, \cf3 MouseX\cf2 .kr(0, 100), \cf3 MouseY\cf2 .kr(0, 1)); \
	\cf3 Out\cf2 .ar(out,  \cf3 IFFT\cf2 (chain).dup);\
\}).play(s,[\cf5 \\out\cf2 , 0, \cf5 \\bufnum\cf2 , b.bufnum, \cf5 \\soundBufnum\cf2 , c.bufnum]);\
)	\
\
(\
\cf3 SynthDef\cf2 (\cf4 "help-magGate2"\cf2 , \{ \cf3 arg\cf2  out=0, bufnum=0, soundBufnum=2;\
	\cf3 var\cf2  in, chain, remove;\
	in = \cf3 PlayBuf\cf2 .ar(1, soundBufnum, \cf3 BufRateScale\cf2 .kr(soundBufnum), loop: 1);\
	chain = \cf3 FFT\cf2 (bufnum, in);\
	remove = \cf3 MouseY\cf2 .kr(0, 1);\
	chain = \cf3 PV_MagGate\cf2 (chain, \cf3 MouseX\cf2 .kr(-50, 0), remove); \
	\cf3 Out\cf2 .ar(out,  (remove * 3 - 2) * \cf3 IFFT\cf2 (chain).dup);\
\}).play(s,[\cf5 \\out\cf2 , 0, \cf5 \\bufnum\cf2 , b.bufnum, \cf5 \\soundBufnum\cf2 , c.bufnum]);\
)		\
		\
\
}